package fr.pud.client.controller.routes;

import java.awt.Color;
import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.JColorChooser;

import fr.pud.client.i18n.LanguagesConstants;
import fr.pud.client.view.MapRoute;

/**
 * Apr 18, 2012 - Projet_Ose.
 * @author Simon Devineau, Adrien Hierry, Leopold Houdin, Pierre Reliquet
 *         Ecole des Mines de Nantes
 *         ChooseRouteColor.java
 */
public class ChooseRouteColor extends AbstractAction {
    /**
     * 
     */
    private static final long serialVersionUID = 1544753338196885125L;
    private MapRoute route;

    /**
     * 
     */
    public ChooseRouteColor(MapRoute aMapRoute) {
        this.putValue(NAME, LanguagesConstants.LANGUAGE
                .getString(LanguagesConstants.CHOOSE_COLOR));
        route = aMapRoute;
    }

    /*
     * (non-Javadoc)
     * @see
     * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    @Override
    public void actionPerformed(ActionEvent aArg0) {
        route.setColor(JColorChooser.showDialog(new JColorChooser(),
                LanguagesConstants.LANGUAGE
                        .getString(LanguagesConstants.CHOOSE_COLOR), Color.BLUE));
    }
}
